<template>
  <section class="app-main" style="min-height: 100%">
    <transition name="fade" mode="out-in">
      <keep-alive :include="cachedViews">
        <!-- <router-view></router-view> -->
        <transition name="fade" mode="out-in">
          <router-view></router-view>
        </transition>
      </keep-alive>
    </transition>
  </section>
</template>

<script>
export default {
  name: 'layoutAppMain',
  computed: {
    cachedViews () {
      return this.$store.state.tagsView.cachedViews
    }
    // key() {
    //   return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
    // }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.app-main {
  position: relative;
  top: 75px;
  // z-index: 0;
}
</style>
<style scoped>

/* 可以设置不同的进入和离开动画 */
/* 设置持续时间和动画函数 */
.fade-enter-active {
  transition: all .3s ease;
}
.fade-leave-active {
  transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}
.fade-enter {
  transform: translateX(15px);
  opacity: 0;
}
.fade-leave-to
/* .slide-fade-leave-active for below version 2.1.8 */ {
  transform: translateX(-25px);
  opacity: 0;
}
</style>
